<form action="{:sysuri()}" method="post" data-auto="true" class="layui-form layui-card">

	<div class="layui-card-body padding-left-40">

		<fieldset class="layui-bg-gray">
			<legend><span class="layui-badge think-bg-violet">公证书</span></legend>
			<div>
				<label class="layui-form-item block relative">
					<span class="color-green font-w7 label-required-prev">公证处</span>
					<span class="color-desc margin-left-5"></span>
					<select class="layui-select" lay-search name="notarial_office_id" id="notarial_office_id"
					        lay-filter="notarial_office_id" readonly>
						{foreach $Offices as $cate}
						{if $cate.id == $matter.notarial_office_id}
						<option value="{$cate.id}" selected>{$cate.name|default=''}</option>
						{else}
						<option value="{$cate.id}">{$cate.name|default=''}</option>
						{/if}
						{/foreach}
					</select>
				</label>
				<label class="layui-form-item block relative">
					<span class="color-green font-w7 label-required-prev">公证事项</span>
					<span class="color-desc margin-left-5"></span>
					<select class='layui-select' name='base_type' lay-search lay-filter="matter" id="matter" readonly>
						{foreach ['委托公证','声明书公证','亲属关系公证'] as $k=>$v}
						{if isset($vo.base_type) && $vo.base_type eq $k}
						<option selected value='{$k}'>{$v}</option>
						{else}
						<option value='{$k}'>{$v}</option>
						{/if}{/foreach}
					</select>
				</label>
				
				{if $vo.base_type != 0}
				<label class="layui-form-item block relative">
					<span class="color-green font-w7 label-required-prev">公证类型</span>
					<span class="color-desc margin-left-5"></span>
					<select class='layui-select' name='matter_id' lay-search id="matter_id" lay-filter="matter_id"
					        readonly>
						{if $vo.base_type != 0}
						{foreach ['本人办理','代理人办理'] as $k=>$v}
						{if $vo.matter_id == 1 && $k==0}
						<option value="{$cate.id}" selected>{$cate.name|default=''}</option>
						{else}
						<option value="{$cate.id}">{$cate.name|default=''}</option>
						{/if}
						{/foreach}
						{else}

						{/if}
					</select>
				</label>
				{/if}


				<label class="layui-form-item block relative">
					<span class="color-green font-w7 label-required-prev">公证书份数</span>
					<span class="color-desc margin-left-5"></span>
					<input class="layui-input" type="number" min="1" data-blur-number="0" name="number_goods"
					       placeholder="请输入商品限购数量" value="{$vo.number_goods|default=1}">
				</label>

			</div>
		</fieldset>


		<fieldset class="layui-bg-gray">
			<legend><span class="layui-badge think-bg-violet">{if $vo.matter_id == '1' and $vo.base_type != '0'}委托人信息{else}代理人+委托人信息{/if}</span>
			</legend>
			<div>
				<label class="layui-form-item block relative">
					<span class="color-green font-w7 label-required-prev client_or_agents_name">姓名</span>
					<span class="color-desc margin-left-5"></span>
					<input class="layui-input" name="client_name" required value='{$vo.client_name|default=""}'>
				</label>

				<label class="layui-form-item block relative">
					<span class="color-green font-w7 label-required-prev client_or_agents_phone">联系电话</span>
					<span class="color-desc margin-left-5"></span>
					<input class="layui-input" name="client_phone" required value='{$vo.client_phone|default=""}'>
				</label>

				<div class="agents_msg" style="display: none;">
					<span class="help-label label-required-prev"><b>代理人身份证</b></span>
					<table class="layui-table">
						<thead>
						<tr>
							<th class="nowrap text-center">身份证正面</th>
							<th class="nowrap text-center">身份证反面</th>
						</tr>
						</thead>
						<tbody>
						<tr ng-if="item.city.length > 0" ng-repeat="item in rules">
							<td class="padding-0 text-center">
								<div style="margin: 0 auto;padding:10px 0;">
									<input name="front_of_agents_id_card" type="hidden"
									       value="{$vo.front_of_agents_id_card|default=''}">
									<script>$('[name="front_of_agents_id_card"]').uploadOneImage();</script>
								</div>
							</td>
							<td class="padding-0 text-center">
								<div style="margin: 0 auto;padding:5px;">
									<input name="reverse_side_of_agents_id_card" type="hidden"
									       value="{$vo.reverse_side_of_agents_id_card|default=''}">
									<script>$('[name="reverse_side_of_agents_id_card"]').uploadOneImage();</script>
								</div>
							</td>
						</tr>
						</tbody>
					</table>
				</div>

				<div>
					<span class="help-label label-required-prev"><b>委托人身份证</b></span>
					<table class="layui-table">
						<thead>
						<tr>
							<th class="nowrap text-center">身份证正面</th>
							<th class="nowrap text-center">身份证反面</th>
						</tr>
						</thead>
						<tbody>
						<tr ng-if="item.city.length > 0" ng-repeat="item in rules">
							<td class="padding-0 text-center">
								<div style="margin: 0 auto;padding:10px 0;">
									<input name="client_front_of_id_card[]" type="hidden"
									       value="{$vo.client_front_of_id_card|default=''}">
									<script>$('[name="client_front_of_id_card[]"]').uploadOneImage();</script>
								</div>
							</td>
							<td class="padding-0 text-center">
								<div style="margin: 0 auto;padding:5px;">
									<input name="client_reverse_side_of_id_card[]" type="hidden"
									       value="{$vo.client_reverse_side_of_id_card|default=''}">
									<script>$('[name="client_reverse_side_of_id_card[]"]').uploadOneImage();</script>
								</div>
							</td>
						</tr>
						</tbody>
					</table>
				</div>


				<span class="help-label"><b>委托人户口本图片</b></span>
				<fieldset class="layui-form-item">
					<div class="help-images text-center">
						<div style="">
							<input name="client_household_register[]" type="hidden"
							       value="{$vo.client_household_register|default=''}">
							<script>$('[name="client_household_register[]"]').uploadMultipleImage();</script>
						</div>
					</div>
				</fieldset>

				<!--亲属关系公证才会显示-->
				<div id="proof_of_relationship">
					<span class="help-label"><b>关系证明图片</b></span>
					<fieldset class="layui-form-item">
						<div class="help-images text-center">
							<div style="">
								<input name="proof_of_relationship" type="hidden"
								       value="{$vo.proof_of_relationship|default=''}">
								<script>$('[name="proof_of_relationship"]').uploadMultipleImage();</script>
							</div>
						</div>
					</fieldset>
				</div>

			</div>
		</fieldset>

		<fieldset class="layui-bg-gray">
			<legend><span class="layui-badge think-bg-violet">{in name='$vo.base_type' value='1,2'}父母婚姻状况{else/}婚姻状况{/in}</span>
			</legend>
			<div>
				<div class="layui-form-item">
					<!--<span class="color-green font-w7 label-required-prev">婚姻状况</span>-->
					<span class="color-desc margin-left-5"></span>
					{foreach ['未婚','已婚','离异'] as $k => $v}
					<!--0未婚,1已婚,2离异-->
					{if $vo.client_marital_status==$k}
					<input name="client_marital_status" title="{$v}" type="radio" value="{$k}"
					       lay-filter="client_marital_status" checked>
					{else}
					<input name="client_marital_status" title="{$v}" type="radio" value="{$k}"
					       lay-filter="client_marital_status">
					{/if}
					{/foreach}
				</div>

				<div class="div_marriage_certificate" style="display: none;">
					<span class="help-label"><b>结婚证</b></span>
					<fieldset class="layui-form-item">
						<div class="help-images">
							<div style="">
								<input name="client_marriage_certificate" type="hidden"
								       value="{$vo.client_marriage_certificate|default=''}">
								<script>$('[name="client_marriage_certificate"]').uploadMultipleImage();</script>
							</div>
						</div>
					</fieldset>
				</div>

				<div class="div_divorce_certificate" style="display: none;">
					<span class="help-label"><b>离婚证</b></span>
					<fieldset class="layui-form-item">
						<div class="help-images">
							<div style="">
								<input name="client_divorce_certificate" type="hidden"
								       value="{$vo.client_divorce_certificate|default=''}">
								<script>$('[name="client_divorce_certificate"]').uploadMultipleImage();</script>
							</div>
						</div>
					</fieldset>


					<!--<span class="help-label"><b>离婚协议</b></span>-->
					<!--<fieldset class="layui-form-item">-->
					<!--    <div class="help-images">-->
					<!--            <input name="client_divorce_agreement" type="hidden" value="">-->
					<!--            <script>$('[name="client_divorce_agreement"]').uploadMultipleImage();</script>-->
					<!--    </div>-->
					<!--</fieldset>-->
				</div>

			</div>
		</fieldset>

		{eq name='$vo.base_type' value='0'}
		<fieldset class="layui-bg-gray">
			<legend><span class="layui-badge think-bg-violet">房产信息</span></legend>
			<div>
				<span class="help-label"><b>房产证</b></span>
				<fieldset class="layui-form-item">
					<div class="help-images">
						<div style="">
							<input name="client_property_ownership_certificate" type="hidden"
							       value="{$vo.client_property_ownership_certificate|default=''}">
							<script>$('[name="client_property_ownership_certificate"]').uploadMultipleImage();</script>
						</div>
					</div>
				</fieldset>

				<span class="help-label"><b>购房协议</b></span>
				<fieldset class="layui-form-item">
					<div class="help-images">
						<input name="client_house_purchase_agreement" type="hidden"
						       value="{$vo.client_house_purchase_agreement|default=''}">
						<script>$('[name="client_house_purchase_agreement"]').uploadMultipleImage();</script>
					</div>
				</fieldset>

				<span class="help-label"><b>房产信息查询(产调)</b></span>
				<fieldset class="layui-form-item">
					<div class="help-images">
						<input name="client_property_information" type="hidden"
						       value="{$vo.client_property_information|default=''}">
						<script>$('[name="client_property_information"]').uploadMultipleImage();</script>
					</div>
				</fieldset>

			</div>
		</fieldset>
		{foreach $vo.trustee_id_card as $k=>$v}
		<fieldset class="layui-bg-gray client_fieldset1">
			<legend>
                    <span class="layui-badge think-bg-violet">
                        受托人(<span class="client_index">{$k+1}</span>)
                    </span>
				<!--<button type="button" class="layui-btn layui-btn-normal addBtn1">+</button>-->
				<!--<button type="button" class="layui-btn layui-btn-danger delBtn1">-</button>-->
			</legend>
			<div>
				<table class="layui-table">
					<thead>
					<tr>
						<th class="nowrap text-center">身份证正面</th>
						<th class="nowrap text-center">身份证反面</th>
					</tr>
					</thead>
					<tbody>
					<tr ng-if="item.city.length > 0" ng-repeat="item in rules">
						<td class="padding-0 text-center">
							<div style="margin: 0 auto;padding:10px 0;">
								<input name="trustee_id_card_z[]" type="hidden" value="{$v.idCard_z|default=''}">
								<script>$('[name="trustee_id_card_z[]"]').uploadOneImage();</script>
							</div>
						</td>
						<td class="padding-0 text-center">
							<div style="margin: 0 auto;padding:5px;">
								<input name="trustee_id_card_f[]" type="hidden" value="{$v.idCard_f|default=''}">
								<script>$('[name="trustee_id_card_f[]"]').uploadOneImage();</script>
							</div>
						</td>
					</tr>
					</tbody>
				</table>
			</div>
		</fieldset>
		{/foreach}
		{/eq}

		{in name='$vo.base_type' value='1,2'}
		<div class="layui-form-item">
			<span class="help-label"><b>父母身份证</b></span>
			<table class="layui-table">
				<thead>
				<tr>
					<th class="nowrap text-center">父亲身份证正面</th>
					<th class="nowrap text-center">父亲身份证反面</th>
					<th class="nowrap text-center">母亲身份证正面</th>
					<th class="nowrap text-center">母亲身份证反面</th>
				</tr>
				</thead>
				<tbody>
				<tr ng-if="item.city.length > 0" ng-repeat="item in rules">
					<td class="padding-0 text-center">
						<div style="margin: 0 auto;padding:10px 0;">
							<input name="front_of_fathers_id_card" type="hidden"
							       value="{$vo.front_of_fathers_id_card|default=''}">
							<script>$('[name="front_of_fathers_id_card"]').uploadOneImage();</script>
						</div>
					</td>
					<td class="padding-0 text-center">
						<div style="margin: 0 auto;padding:10px 0;">
							<input name="reverse_side_of_fathers_id_card" type="hidden"
							       value="{$vo.reverse_side_of_fathers_id_card|default=''}">
							<script>$('[name="reverse_side_of_fathers_id_card"]').uploadOneImage();</script>
						</div>
					</td>
					<td class="padding-0 text-center">
						<div style="margin: 0 auto;padding:10px 0;">
							<input name="front_of_mothers_id_card" type="hidden"
							       value="{$vo.front_of_mothers_id_card|default=''}">
							<script>$('[name="front_of_mothers_id_card"]').uploadOneImage();</script>
						</div>
					</td>
					<td class="padding-0 text-center">
						<div style="margin: 0 auto;padding:10px 0;">
							<input name="reverse_side_of_mothers_id_card" type="hidden"
							       value="{$vo.reverse_side_of_mothers_id_card|default=''}">
							<script>$('[name="reverse_side_of_mothers_id_card"]').uploadOneImage();</script>
						</div>
					</td>
				</tr>
				</tbody>
			</table>
		</div>
		<span class="help-label"><b>父母户口本</b></span>
		<fieldset class="layui-form-item">
			<div class="help-images">
				<input name="parents_household_register" type="hidden"
				       value="{$vo.parents_household_register|default=''}">
				<script>$('[name="parents_household_register"]').uploadMultipleImage();</script>
			</div>
		</fieldset>
		{/in}
		<span class="help-label"><b>其他</b></span>
		<fieldset class="layui-form-item">
			<div class="help-images">
				<input name="other" type="hidden" value="{$vo.other|default=''}">
				<script>$('[name="other"]').uploadMultipleImage();</script>
			</div>
		</fieldset>

		{if $vo.status == 4 or $vo.status == 5 or $vo.status == 8}
		<!-- 调用视频方式修改  暂时无法使用 -->
		<span class="help-label"><b>视频取证</b></span>
		<fieldset class="layui-form-item">
			<div class="help-images">
				{foreach $vo.video_src as $val}
				<video class="video_src" width="76" height="76" controls="">
					<source src="{$val}" type="video/mp4">
				</video>
				{/foreach}
			</div>
		</fieldset>
		{/if}
		<!--订单流程状态(0已取消,1信息确认中,2信息有误,3待认证,4待视频取证,5认证通过,6认证失败,7审批人审核,8已完成)-->
		{if $vo.status == 25 and $vo.status != 8}
		<div class="layui-form-item proxy_statement_div">
			<!--<span class="color-green font-w7 label-required-prev">委托/声明书</span>-->
			<span class="color-desc margin-left-5"></span>
			<table class="layui-table">
				<thead>
				<tr>
					<th class="text-center label-required-prev" style="width:90px">委托/声明书</th>
				</tr>
				<tr>
					<th>
						<div class="relative block">
							<textarea class="layui-hide" name="proxy_statement" placeholder="请输入委托/声明书">{$vo.proxy_statement|default=''}</textarea>
						</div>
					</th>
				</tr>
				</thead>
			</table>
		</div>

		<div class="layui-form-item read_agreement_div">
			<span class="color-green font-w7 label-required-prev">阅读协议</span>
			<span class="color-desc margin-left-5"></span>
			<table class="layui-table">
				<thead>
				<tr>
					<th class="text-center" style="width:90px">公证申请表</th>
				</tr>
				<tr>
					<th>
						<div class="relative block">
							<textarea class="layui-hide" name="read_agreement5" placeholder="请输入公证申请表">{$vo.read_agreement5|default=''}</textarea>
						</div>
					</th>
				</tr>

				<tr>
					<th class="text-center" style="width:90px">公证受理通知单</th>
				</tr>
				<tr>
					<th>
						<div class="relative block">
							<textarea class="layui-hide" name="read_agreement4" placeholder="请输入公证受理通知单">{$vo.read_agreement4|default=''}</textarea>
						</div>
					</th>
				</tr>


				<tr>
					<th class="text-center" style="width:90px">公证告知书</th>
				</tr>
				<tr>
					<th>
						<div class="relative block">
							<textarea class="layui-hide" name="read_agreement3" placeholder="请输入公证告知书">{$vo.read_agreement3|default=''}</textarea>
						</div>
					</th>
				</tr>

				<tr>
					<th class="text-center" style="width:90px">谈话笔录</th>
				</tr>
				<tr>
					<th>
						<div class="relative block">
							<textarea class="layui-hide" name="read_agreement2" placeholder="请输入谈话笔录">{$vo.read_agreement2|default=''}</textarea>
						</div>
					</th>
				</tr>


				<tr>
					<th class="text-center" style="width:90px">其他</th>
				</tr>
				<tr>
					<th>
						<div class="relative block">
							<textarea class="layui-hide" name="read_agreement1" placeholder="请输入其他">{$vo.read_agreement1|default=''}</textarea>
						</div>
					</th>
				</tr>






				</thead>
			</table>
		</div>
		{else}
		<!--待审核 阅读协议图片-->
		<!--委托书-->
		

		<div class="proxy_div crubR1">
			<div id="image1" style="width:620px;padding: 20px;background: #ffffff;">
				{if $vo.proxy.proxy_type == 0}
				<div class="help-title">委托书</div>
				{else}
				<div class="help-title">{$vo.proxy.proxy_title}</div>
				{/if}
				<div class="help-content">
					{foreach $vo.proxy.user as $v}
					{$vo.proxy.proxy_type == '0' ? '委托人':'声明人'}: {$v.client_name},{$v.client_sex},{$v.client_birthday}出生,
					公民身份号码:{$v.client_id_number}。
					{/foreach}
					{foreach $vo.proxy.user_s as $v}
					受托人: {$v.client_name},{$v.client_sex},{$v.client_birthday}出生,
					公民身份号码:{$v.client_id_number}。
					{/foreach}
					{$vo.proxy.html|raw}
					<div>
						{$vo.proxy.proxy_type == '0' ? '委托人':'声明人'}签名:
					</div>
					<div>
						{if $vo.proxy.sign_img_src != ""}
						<image class="end_sign_img" src="{$vo.proxy.sign_img_src}" style="max-width:230px;" alt=""/>
						{/if}
					</div>
				</div>
				<div class="help-footer">
					日期:{$vo.proxy.create_at}
				</div>
			</div>
		</div>

		<!--阅读协议-->
		<div class="proxy_div crubR2" >
			<div id="image2" style="width:920px;padding: 20px;background: #ffffff;">
				<div class="help-title">阅读协议</div>
				<div class="help-content">
					{foreach $docunmentListPath as $k=>$v}
						<!-- <div class="help-small-title">
							{$v.title}
						</div> -->
						<div class="help-content">
							<div id="pdf-container-{$k}">正在加载 PDF 文件...</div>
						</div>
					{/foreach}
					
					{foreach $docunmentListPath as $k=>$v}
						<!-- <div class="help-small-title">
							{$v.title}
						</div> -->
						<div class="help-content">
							<embed  src="{$v.filePath}" type="application/pdf" width="100%" height="600px"></embed>
						
						</div>
					{/foreach}



				</div>
				<div class="help-footer">
				</div>
			</div>
		</div>


		{/if}

		{if $vo.status == 8}
		<!--<label class="layui-form-item relative block">-->
		<!--    <span class="help-label"><b>审批人</b></span>-->
		<!--    <input class="layui-input" name="approval_name" placeholder="请输入审批人名字" required value='{$vo.approval_name|default=""}'>-->
		<!--</label>-->
		{/if}

		<!--<label class="layui-form-item relative block">-->
		<!--    <span class="color-green font-w7">订单审核描述</span>-->
		<!--    <span class="color-desc margin-left-5"></span>-->
		<!--    <textarea class="layui-textarea" name="reason_for_rejection" placeholder="请输入订单审核描述">{$vo.reason_for_rejection|default=''}</textarea>-->
		<!--</label>-->
	</div>
</form>
<style>
    .video_src + .video_src {
        margin-left: 10px;
    }

    .proxy_div {
        /*width: 55%;*/
        margin: 0 auto;
	    pointer-events:none;
	    display: flex;
        justify-content: center;
    }

    .proxy_div:before {
        content: ' ';
	    pointer-events: auto;
        display: block;
        width: 30px;
        height: 30px;
        border-radius: 10px; /**控制形状**/
        backgroud: #000; /**控制图标颜色**/
	    background-image: url('down.png');
        margin-right: 10px; /**图标与文字距离**/
	    cursor: pointer;
    }

    .help-title {
        text-align: center;
        font-weight: bold;
        font-size: 20px;
        padding: 15px;
    }

    .help-content {
        line-height: 30px;
        font-size: initial;
    }
    .help-footer{
	    font-size: 20px;
        text-align: right;
    }
    .help-small-title{
	    text-align: center;
	    font-size: 17px;
	    font-weight: bold;
    }
    .layui-layer-page{
	    z-index: 222 !important;
    }
    .layui-layer-shade{
	    z-index: 222 !important;
    }
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.8.335/pdf.min.js"></script>  
<script>


 function pdfToimg(url,idName){
	
	 // 设置线上 PDF 文件的 URL
	 const pdfUrl = url//"http://127.0.0.1:31840/qyspdf/3305891150744863376/3305891161310347588.pdf"; // 替换为实际的线上 PDF 地址
	 const container = document.getElementById(idName);  
	console.log(idName)
        pdfjsLib.getDocument(pdfUrl).promise.then((pdf) => {  
          const numPages = pdf.numPages;  
          const pagesPromises = [];  
	
          for (let i = 1; i <= numPages; i++) {  
            pagesPromises.push(renderPage(pdf, i));  
          }  
	
          Promise.all(pagesPromises)  
            .then((pages) => {  
              const combinedHtml = pages.join("");  
              container.innerHTML = combinedHtml;  
            })  
            .catch((error) => {  
              console.error("Error rendering pages:", error);  
  		});  
        });  
 }		
	
  function renderPage(pdf, pageNumber) { 
  return new Promise((resolve, reject) => { 
    pdf.getPage(pageNumber).then((page) => { 
      const scale = 1.5; 
      const viewport = page.getViewport({ scale }); 

      const canvas = document.createElement("canvas"); 
      const context = canvas.getContext("2d"); 
      canvas.height = viewport.height; 
      canvas.width = viewport.width; 

      const renderContext = { 
        canvasContext: context, 
        viewport, 
      }; 

      page 
       .render(renderContext) 
       .promise.then(() => { 
          const html = canvas.toDataURL(); 
          resolve(`<img src="${html}" alt="Page ${pageNumber}">`); 
        }) 
       .catch((error) => { 
          console.error(`Error rendering page ${pageNumber}:`, error); 
          reject(error); 
        }); 
    }); 
  }); 
}
  


  layui.form.render();
  // 不同公证事项显示不同的表单
  $(function () {
    var selectedOption = $("#matter").find("option:selected").val(); //value值
    if (selectedOption == 0) {
      $(".addBtn").show();
      $("#proof_of_relationship").hide(); //关系证明
      $("#entrusted_notarization").show(); //房产
      $("#parental_information").hide(); //父母
    } else if (selectedOption == 1) {
      $(".addBtn").hide();
      $("#proof_of_relationship").hide();
      $("#entrusted_notarization").hide();
      $("#parental_information").show(); //父母
    } else {
      $(".addBtn").hide();
      $("#proof_of_relationship").show();
      $("#entrusted_notarization").hide();
      $("#parental_information").show(); //父母
    }
	{foreach $docunmentListPath as $k=>$v}
		pdfToimg('{$v.filePath}','pdf-container-{$k}')
	{/foreach}
	
  });
  function onclient_marital_status(status) {
    //未婚
    if (status == 0) {
      $(".div_marriage_certificate,.div_divorce_certificate").hide();
    }
    //已婚
    else if (status == 1) {
      $(".div_marriage_certificate,.div_divorce_certificate").hide();
      $(".div_marriage_certificate").show();
    }
    //离异
    else {
      $(".div_marriage_certificate,.div_divorce_certificate").hide();
      $(".div_divorce_certificate").show();
    }
  }

  form.on("radio(client_marital_status)", function (data) {
    onclient_marital_status(data.value)
  })

  let client_marital_status = '{$vo.client_marital_status}'
  onclient_marital_status(client_marital_status)

  form.on("select(matter)", function (data) {
    if (data.value == 0) {
      $(".addBtn,.delBtn").show();
      $("#proof_of_relationship").hide(); //关系证明
      $("#entrusted_notarization").show(); //房产
      $("#parental_information").hide(); //父母
      //委托书
      $(".proxy_statement_div").show(); //委托书
    } else if (data.value == 1) {
      $(".addBtn,.delBtn").hide();
      $("#proof_of_relationship").hide();
      $("#entrusted_notarization").hide();
      $("#parental_information").show(); //父母
      //委托书
      $(".proxy_statement_div").hide(); //委托书
    } else {
      $(".addBtn,.delBtn").hide();
      $("#proof_of_relationship").show();
      $("#entrusted_notarization").hide();
      $("#parental_information").show(); //父母
      //委托书
      $(".proxy_statement_div").hide(); //委托书
    }

    // 二级联动
    let notarial_office_id = $("#notarial_office_id").val()

    let matter_id = '{$vo.matter_id}'

    postData = {'matter': data.value, 'notarial_office_id': notarial_office_id};
    url = "{:url('linkage')}";
    $.post(url, postData, function (result) {
      //将信息填充到html中
      html = "";
      $(result).each(function (i) {
        html += "<option value='" + this.id + "'>" + this.name + "</option>";
      });
      $('#matter_id').html(html);
      $('#matter_id').val(matter_id);
      form.render();
      $("#matter_id").next().find('.layui-this').trigger('click')
    }, 'json')
  });

  form.on("select(matter_id)", function (data) {
    //本人办理
    if (data.value == 1 || $("#matter").val() == 0) {
      $(".agents_msg").hide();
      $(".client_or_agents_name").text("委托人姓名")
      $(".client_or_agents_phone").text("委托人电话")
    }
    //代理人办理
    else if (data.value == 2) {
      $(".agents_msg").show();
      $(".client_or_agents_name").text("代理人姓名")
      $(".client_or_agents_phone").text("代理人电话")
    }
  });


  $("#matter").next().find('.layui-this').trigger('click')

  form.on("select(notarial_office_id)", function (data) {
    $("#matter").next().find('.layui-this').trigger('click')
  })

  {if $vo.status != 5 and $vo.status != 8}
  require(['ckeditor'], function () {
    window.createEditor('[name=proxy_statement]', {height: 350})
    window.createEditor('[name=read_agreement1]', {height: 350})
    window.createEditor('[name=read_agreement2]', {height: 350})
    window.createEditor('[name=read_agreement3]', {height: 350})
    window.createEditor('[name=read_agreement4]', {height: 350})
    window.createEditor('[name=read_agreement5]', {height: 350})
  });
  {/if}

</script>
{include file='/shop/order/js'}